import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '系统界面' },
            children: [
                // 首页
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/user',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/User.vue'),
                    meta: { title: '用户中心' }
                },{ 
                    // 公告
                    path: '/notice',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/Notice.vue'),
                    meta: { title: '系统公告' }
                },{ 
                    // 公告
                    path: '/uploadNotice',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/uploadNotice.vue'),
                    meta: { title: '编辑公告' }
                },{ //教室管理
                    path: '/classRoom',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/classRoom.vue'),
                    meta: { title: '教室管理' }
                },{
                    path: '/applyClass',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/applyClass.vue'),
                    meta: { title: '教室审核' }
                },{     //活动
                    path: '/adminApplied',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/adminApplied.vue'),
                    meta: { title: '已审核活动' }
                },{
                    path: '/adminAppling',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/adminAppling.vue'),
                    meta: { title: '未审核活动' }
                },{
                    path: '/endAppled',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/endAppled.vue'),
                    meta: { title: '未审核活动' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
